3.225 \(\int \frac{\tan ^3(e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=69 \[ \frac{\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)^2}-\frac{a}{2 b f (a-b) \left (a+b \tan ^2(e+f x)\right )} \]

[Out]

Log[a*Cos[e + f*x]^2 + b*Sin[e + f*x]^2]/(2*(a - b)^2*f) - a/(2*(a - b)*b*f*(a + b*Tan[e + f*x]^2))

________________________________________________________________________________________

Rubi [A]  time = 0.100146, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 77} \[ \frac{\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)^2}-\frac{a}{2 b f (a-b) \left (a+b \tan ^2(e+f x)\right )} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^3/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

Log[a*Cos[e + f*x]^2 + b*Sin[e + f*x]^2]/(2*(a - b)^2*f) - a/(2*(a - b)*b*f*(a + b*Tan[e + f*x]^2))

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin{align*} \int \frac{\tan ^3(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^3}{\left (1+x^2\right ) \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{x}{(1+x) (a+b x)^2} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (-\frac{1}{(a-b)^2 (1+x)}+\frac{a}{(a-b) (a+b x)^2}+\frac{b}{(a-b)^2 (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 (a-b)^2 f}-\frac{a}{2 (a-b) b f \left (a+b \tan ^2(e+f x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.54052, size = 61, normalized size = 0.88 \[ \frac{\frac{a (b-a)}{b \left (a+b \tan ^2(e+f x)\right )}+\log \left (a+b \tan ^2(e+f x)\right )+2 \log (\cos (e+f x))}{2 f (a-b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^3/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(2*Log[Cos[e + f*x]] + Log[a + b*Tan[e + f*x]^2] + (a*(-a + b))/(b*(a + b*Tan[e + f*x]^2)))/(2*(a - b)^2*f)

________________________________________________________________________________________

Maple [A]  time = 0.023, size = 109, normalized size = 1.6 \begin{align*}{\frac{\ln \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) ^{2}}}-{\frac{{a}^{2}}{2\,f \left ( a-b \right ) ^{2}b \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{a}{2\,f \left ( a-b \right ) ^{2} \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/2/f/(a-b)^2*ln(a+b*tan(f*x+e)^2)-1/2/f*a^2/(a-b)^2/b/(a+b*tan(f*x+e)^2)+1/2/f/(a-b)^2*a/(a+b*tan(f*x+e)^2)-1
/2/f/(a-b)^2*ln(1+tan(f*x+e)^2)

________________________________________________________________________________________

Maxima [A]  time = 1.16054, size = 119, normalized size = 1.72 \begin{align*} \frac{\frac{a}{a^{3} - 2 \, a^{2} b + a b^{2} -{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \sin \left (f x + e\right )^{2}} + \frac{\log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{2} - 2 \, a b + b^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/2*(a/(a^3 - 2*a^2*b + a*b^2 - (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*sin(f*x + e)^2) + log(-(a - b)*sin(f*x + e)^2
+ a)/(a^2 - 2*a*b + b^2))/f

________________________________________________________________________________________

Fricas [A]  time = 1.14962, size = 234, normalized size = 3.39 \begin{align*} \frac{a \tan \left (f x + e\right )^{2} +{\left (b \tan \left (f x + e\right )^{2} + a\right )} \log \left (\frac{b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) + a}{2 \,{\left ({\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} f \tan \left (f x + e\right )^{2} +{\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/2*(a*tan(f*x + e)^2 + (b*tan(f*x + e)^2 + a)*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1)) + a)/((a^2*b -
 2*a*b^2 + b^3)*f*tan(f*x + e)^2 + (a^3 - 2*a^2*b + a*b^2)*f)

________________________________________________________________________________________

Sympy [A]  time = 48.6895, size = 930, normalized size = 13.48 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**3/(a+b*tan(f*x+e)**2)**2,x)

[Out]

Piecewise((zoo*x/tan(e), Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (-2*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**4 + 8*b*
*2*f*tan(e + f*x)**2 + 4*b**2*f) - 1/(4*b**2*f*tan(e + f*x)**4 + 8*b**2*f*tan(e + f*x)**2 + 4*b**2*f), Eq(a, b
)), ((-log(tan(e + f*x)**2 + 1)/(2*f) + tan(e + f*x)**2/(2*f))/a**2, Eq(b, 0)), (x*tan(e)**3/(a + b*tan(e)**2)
**2, Eq(f, 0)), (-a**2/(2*a**3*b*f + 2*a**2*b**2*f*tan(e + f*x)**2 - 4*a**2*b**2*f - 4*a*b**3*f*tan(e + f*x)**
2 + 2*a*b**3*f + 2*b**4*f*tan(e + f*x)**2) + a*b*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a**3*b*f + 2*a**2
*b**2*f*tan(e + f*x)**2 - 4*a**2*b**2*f - 4*a*b**3*f*tan(e + f*x)**2 + 2*a*b**3*f + 2*b**4*f*tan(e + f*x)**2)
+ a*b*log(I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a**3*b*f + 2*a**2*b**2*f*tan(e + f*x)**2 - 4*a**2*b**2*f - 4*
a*b**3*f*tan(e + f*x)**2 + 2*a*b**3*f + 2*b**4*f*tan(e + f*x)**2) - a*b*log(tan(e + f*x)**2 + 1)/(2*a**3*b*f +
 2*a**2*b**2*f*tan(e + f*x)**2 - 4*a**2*b**2*f - 4*a*b**3*f*tan(e + f*x)**2 + 2*a*b**3*f + 2*b**4*f*tan(e + f*
x)**2) + a*b/(2*a**3*b*f + 2*a**2*b**2*f*tan(e + f*x)**2 - 4*a**2*b**2*f - 4*a*b**3*f*tan(e + f*x)**2 + 2*a*b*
*3*f + 2*b**4*f*tan(e + f*x)**2) + b**2*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))*tan(e + f*x)**2/(2*a**3*b*f +
 2*a**2*b**2*f*tan(e + f*x)**2 - 4*a**2*b**2*f - 4*a*b**3*f*tan(e + f*x)**2 + 2*a*b**3*f + 2*b**4*f*tan(e + f*
x)**2) + b**2*log(I*sqrt(a)*sqrt(1/b) + tan(e + f*x))*tan(e + f*x)**2/(2*a**3*b*f + 2*a**2*b**2*f*tan(e + f*x)
**2 - 4*a**2*b**2*f - 4*a*b**3*f*tan(e + f*x)**2 + 2*a*b**3*f + 2*b**4*f*tan(e + f*x)**2) - b**2*log(tan(e + f
*x)**2 + 1)*tan(e + f*x)**2/(2*a**3*b*f + 2*a**2*b**2*f*tan(e + f*x)**2 - 4*a**2*b**2*f - 4*a*b**3*f*tan(e + f
*x)**2 + 2*a*b**3*f + 2*b**4*f*tan(e + f*x)**2), True))

________________________________________________________________________________________

Giac [B]  time = 1.73646, size = 397, normalized size = 5.75 \begin{align*} \frac{\frac{\log \left (a + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{2} - 2 \, a b + b^{2}} - \frac{2 \, \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}{a^{2} - 2 \, a b + b^{2}} - \frac{a + \frac{6 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{8 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{{\left (a^{2} - 2 \, a b + b^{2}\right )}{\left (a + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/2*(log(a + 2*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*
x + e) - 1)^2/(cos(f*x + e) + 1)^2)/(a^2 - 2*a*b + b^2) - 2*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)/(a
^2 - 2*a*b + b^2) - (a + 6*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 8*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1)
 + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/((a^2 - 2*a*b + b^2)*(a + 2*a*(cos(f*x + e) - 1)/(cos(f*x + e)
 + 1) - 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)))/f